package com.ssn.state.vip;

public class Context {
    private Level level;
    Context(){
        level = new PublicVip(this);
    }
    public void setLevel(Level level) {
        this.level = level;
    }
    public Level getLevel() {
        return level;
    }
    public void buy(){
        level.buy();
    }
    public void transfer(){
        level.transfer();
    }
    public void checkLevel(int score){
        level.checkLevel(score);
    }
    public void icon(){
        level.icon();
    }
    public void menu(){
        level.menu();
    }
    public void login(){
        System.out.println("login ...");
        if (level.level_up){
            System.out.println("恭喜升级为： " + getLevel().name +" !!!图标和功能都已经发生改变了");
            level.level_up = !level.level_up;
        }
        icon();
        menu();
    }
}
